<template>
  <div class="steel-analysis">
    <div class="page-header">
      <h2>钢材分析</h2>
      <p>钢材销售数据分析与统计</p>
    </div>
    
    <div class="analysis-content">
      <div class="stats-cards">
        <div class="stat-card">
          <div class="stat-icon">📊</div>
          <div class="stat-info">
            <h3>总销售量</h3>
            <p class="stat-value">{{ totalSales }} 吨</p>
          </div>
        </div>
        
        <div class="stat-card">
          <div class="stat-icon">💰</div>
          <div class="stat-info">
            <h3>总销售额</h3>
            <p class="stat-value">¥{{ totalAmount.toLocaleString() }}</p>
          </div>
        </div>
        
        <div class="stat-card">
          <div class="stat-icon">📈</div>
          <div class="stat-info">
            <h3>平均单价</h3>
            <p class="stat-value">¥{{ averagePrice }}/吨</p>
          </div>
        </div>
        
        <div class="stat-card">
          <div class="stat-icon">🎯</div>
          <div class="stat-info">
            <h3>毛利率</h3>
            <p class="stat-value">{{ profitMargin }}%</p>
          </div>
        </div>
      </div>
      
      <div class="chart-section">
        <div class="chart-card">
          <h3>钢材销售趋势</h3>
          <div class="chart-placeholder">
            <p>钢材销售趋势图表</p>
          </div>
        </div>
        
        <div class="chart-card">
          <h3>钢材品种分布</h3>
          <div class="chart-placeholder">
            <p>钢材品种分布图表</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'SteelAnalysis',
  data() {
    return {
      totalSales: 12580,
      totalAmount: 25600000,
      averagePrice: 2035,
      profitMargin: 15.8
    }
  }
}
</script>

<style scoped>
.steel-analysis {
  padding: 20px;
  background: #f5f7fa;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 30px;
}

.page-header h2 {
  margin: 0 0 8px 0;
  color: #303133;
  font-size: 24px;
}

.page-header p {
  margin: 0;
  color: #909399;
  font-size: 14px;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 15px;
}

.stat-icon {
  font-size: 32px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f9ff;
  border-radius: 50%;
}

.stat-info h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #909399;
  font-weight: normal;
}

.stat-value {
  margin: 0;
  font-size: 24px;
  font-weight: bold;
  color: #303133;
}

.chart-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.chart-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
  margin: 0 0 20px 0;
  font-size: 16px;
  color: #303133;
}

.chart-placeholder {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 4px;
  color: #909399;
}
</style>